﻿<!--
   Semantic tags library : Tutorial
   author : Fabien Gandon
 -->
<jsp:root 
		  xmlns:jsp="http://java.sun.com/JSP/Page" 
          xmlns:stl="http://ns.inria.fr/sewese/semtags/" 
          xmlns:c="http://java.sun.com/jsp/jstl/core#" 
          xmlns:fn="http://java.sun.com/jsp/jstl/functions#"
          version="2.0">

<jsp:output omit-xml-declaration="yes" />
<jsp:output doctype-root-element="html"
     doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
     doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<jsp:directive.page contentType="text/html;charset=UTF-8" />		
	<html>
  		<head>
     		<title>Application de test de Semtag</title>
     		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
     		<link rel="stylesheet" type="text/css" href="tutorial.css" /> 
		</head>
		<body>
		
        	<c:if test="${empty applicationScope['defaultEngineWrapper']}">
				<stl:init ontoDir="WEB-INF/data/schemas" annotDir="WEB-INF/data/annotations" ruleDir="WEB-INF/data/rules" 
				humans="http://www.inria.fr/2007/04/17/humans.rdfs#"/>
				
			</c:if>
			
			<h2>Add a person</h2>
			<div>
			  <form action="add-person.jsp" method="post">
				Add a person named: <input type="TEXT" name="name" size="30"></input>
				<input type="SUBMIT" name="Submit"></input>
			  </form>
			</div>
			
			<h2>résultat de requête</h2>
			<div>
				<ul>
					<stl:for-each-result query="select ?name ?age WHERE {?x humans:name ?name. OPTIONAL{?x humans:age ?age}}">
						<li>${name} <c:if test="${!empty age}">(${age})</c:if></li>
					</stl:for-each-result>
				</ul>
			</div>
			
			<h2>Âge de John</h2>
			<div>
				<c:set var="myQuery" value="select ?age WHERE {?x humans:name 'John'. ?x humans:age ?age}"/>
				${stl:quickQuery(pageContext, myQuery)}
			</div>
			
			<H2>Sous-classes animal </H2>
			<div>
				<ul>
				<stl:for-each-child root="http://www.inria.fr/2007/04/17/humans.rdfs#Animal" var="child">
					<stl:for-each-label uri="${child}" var="childLabel">
						<li>${childLabel} : ${child}</li>
					</stl:for-each-label>
				</stl:for-each-child>
				</ul>
			</div>
			
		</body>
	</html>
</jsp:root>